package controller.admin.setmeal;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.DTO.SetmealEditDTO;
import service.Impl.SetmealServiceImpl;
import util.GetJsonUtil;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/setmeal/status/edit")
public class SetmealStatusEditController extends HttpServlet {
    //修改套餐售卖状态
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        SetmealEditDTO seD= (SetmealEditDTO) GetJsonUtil.get(req,new SetmealEditDTO());
//        SetmealEditDTO seD=new SetmealEditDTO();
        int id= Integer.parseInt(req.getParameter("id"));
        SetmealServiceImpl ss=new SetmealServiceImpl();
//        seD.setId(Integer.parseInt(req.getParameter("id")));
        ss.statusEdit(id);
        String json= ResultUtil.getJSON(null);
        resp.getWriter().println(json);
    }
}
